package com.yidu.verycd_reception.service.impl;

import com.yidu.verycd_reception.diaoyong.BackgroundClient;
import com.yidu.verycd_reception.entity.VerycdUser;
import com.yidu.verycd_reception.service.VerycdUserService;
import com.yidu.verycd_reception.util.BaseMessage;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * (VerycdUser)表服务实现类
 *
 * @author makejava
 * @since 2020-07-29 09:54:19
 */
@Service("verycdUserService")
public class VerycdUserServiceImpl implements VerycdUserService {


    @Resource
    private VerycdUserService verycdUserService;
    @Resource
    BackgroundClient backgroundClient;

    @Override
    public Map<String, Object> findAll(VerycdUser verycdUser) {

        return backgroundClient.fondAll(verycdUser.getPage(),verycdUser.getLimit(),verycdUser.getUserName(),verycdUser.getUserPhone());
    }

    @Override
    public BaseMessage deleteById(Integer userId) {

        return backgroundClient.deleteById(userId);
    }

    @Override
    public BaseMessage insertOrUpdate(VerycdUser verycdUser) {
        return backgroundClient.insertOrUpdate(verycdUser.getUserId(),verycdUser.getUserName(),verycdUser.getUserPwd(),verycdUser.getUserSex(),verycdUser.getUserPhone());
    }

    @Override
    public VerycdUser selectOne(Integer userId) {
        return backgroundClient.selectOne(userId);
    }

    @Override
    public BaseMessage dyRegist(VerycdUser verycdUser) {
        return backgroundClient.dyRegist(verycdUser.getUserName(),verycdUser.getUserPwd(),verycdUser.getUserPhone());
    }

    @Override
    public BaseMessage dyLogin(VerycdUser verycdUser) {
        return backgroundClient.dyLogin(verycdUser.getUserName(),verycdUser.getUserPwd());
    }


}